#include "apue.h"
struct mp3_head {
	char header[3];
	char ver;
	char revision;
	char flag;
	char size[4];
};

int main() {
	FILE *fp = fopen("m2.mp3", "r+");
	struct mp3_head mh;
	size_t len = fread(&mh, sizeof(struct mp3_head), 1, fp);
	printf("len = %ld\n", len);

	if (len == 1) {
		printf("header = %s\n", mh.header);
		printf("ver = %d\n", mh.ver);
		printf("revison = %d\n", mh.revision);
		printf("flag = %d\n", mh.flag);
		printf("size = %s\n", mh.size);
	} else {
		printf("ferror = %d\n", ferror(fp));
		printf("feof = %d\n", feof(fp));
	}

	printf("off = %ld\n", ftell(fp));

	return 0;
}
